package ai.plantdata.Creation.mode.AbstractFactoryPattern.producer;

import ai.plantdata.Creation.mode.AbstractFactoryPattern.abstracts.AbstractFactory;
import ai.plantdata.Creation.mode.AbstractFactoryPattern.factory.ColorFactory;
import ai.plantdata.Creation.mode.AbstractFactoryPattern.factory.ShapeFactory;
/**
 * @Author: WangHui
 * @Date: 2020/12/18 11:42
 * @Description:
 */
public class FactoryProducer {
    public static AbstractFactory getFactory(String choice){
        if("SHAPE".equalsIgnoreCase(choice)){
            return new ShapeFactory();
        }else if("COLOR".equalsIgnoreCase(choice)){
            return new ColorFactory();
        }
        return null;
    }
}
